import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

import languages.C;
import languages.Java;
import languages.Language;
import languages.Python;
import languages.Ruby;
import languages.Scala;


public class Input {
	private boolean webbased;
	private boolean crossplatform;
	private Language language;
	
	/**
	 * 1. C
	 * 2. Java
	 * 3. Python
	 * 4. Ruby
	 * 5. Scala
	 * @throws IOException
	 */

	public Input(){
	}
	
	public Case makeCase() throws IOException{
		
		Scanner scan = new Scanner(System.in);
		
		//Används för similarity:
		System.out.println("Enter team size: ");
		int teamsize = scan.nextInt();
		System.out.println("Is the project web-based? (Y/N): ");
		String temp = scan.next();
		if(temp.compareTo("Y") == 0 || temp.compareTo("y") == 0){
			webbased = true;
		}
		System.out.println("Is the project on a cross-platform? (Y/N): ");
		String cross = scan.next();
		if(cross.compareTo("Y") == 0 || cross.compareTo("y") == 0){
			crossplatform = true;
		}
		System.out.println("Enter the database size (MB): ");
		int dbsize = scan.nextInt();
		System.out.println("Enter expected users: ");
		int users = scan.nextInt();
		System.out.println("Choose language: \n 1. C \n 2. Java \n 3. Python \n 4. Ruby \n 5. Scala");
		
		switch(scan.nextInt()){
			case 1:
				language = new C();
				break;
			case 2:
				language = new Java();
				break;
			case 3:
				language = new Python();
				break;
			case 4:
				language = new Ruby();
				break;
			case 5:
				language = new Scala();
				break;
		}
		System.out.println("Test Required, on a scale 0-10:");
		int test = scan.nextInt();
		
		//Används för predicted effort:
		System.out.println("Enter lines of code(an input of 1 means 1000 LoC): ");
		int linesofCode = scan.nextInt();
//		System.out.println("Enter effort days: ");
//		int days = scan.nextInt();
		int days = 0;
		System.out.println("Enter experience, where 0 is beginner and 10 is pro: ");
		int experience = scan.nextInt();
		
		
		
		return new Case(teamsize, webbased, crossplatform, dbsize, users, test, linesofCode, days, experience, language);
		
	}
}
